#pragma once
/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Foundation Framework Class Library
 * Version 2.00
 * 
 * Linger Structure
 *      Maintains information about a specific socket that specifies how that socket 
 * should behave when data is queued to be sent and the closesocket function is 
 * called on the socket.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
#include "stdafx.h"
#include "SocketOptionCollection.h"
#include "BoolSocketOption.h"
#include "DwordSocketOption.h"
#include "LingerSocketOption.h"

using namespace System;
using namespace System::Runtime;
using namespace System::Runtime::InteropServices;
using namespace System::Net;
using namespace System::Net::Sockets;

namespace Adaptive
{
	namespace Network
	{
		namespace Sockets
		{
			public ref class SocketOptionFactory sealed
			{
			private:
				SocketOptionFactory();

			public:
				/// <summary>
				/// Creates the list of Socket Options for the Socket Level.
				/// </summary>
				/// <returns>
				/// A <see cref="SocketOptionCollection"/> instance containing the socket options objects.
				/// </returns>
				static SocketOptionCollection^ GetSocketOptions();
				/// <summary>
				/// Creates the list of Socket Options for the IP Level.
				/// </summary>
				/// <returns>
				/// A <see cref="SocketOptionCollection"/> instance containing the socket options objects.
				/// </returns>
				static SocketOptionCollection^ GetIpOptions();
				/// <summary>
				/// Creates the list of Socket Options for the TCP Level.
				/// </summary>
				/// <returns>
				/// A <see cref="SocketOptionCollection"/> instance containing the socket options objects.
				/// </returns>
				static SocketOptionCollection^ GetTcpOptions();
				/// <summary>
				/// Creates the list of Socket Options for the UDP Level.
				/// </summary>
				/// <returns>
				/// A <see cref="SocketOptionCollection"/> instance containing the socket options objects.
				/// </returns>
				static SocketOptionCollection^ GetUdpOptions();
				/// <summary>
				/// Creates a socket option object for the specified option type.
				/// </summary>
				/// <param name="name">A <see cref="SocketOptionName"/> enumerated value indicating the type of 
				/// object to be created.</param>
				/// <returns>
				/// An <see cref="ISocketOption"/> instance representing the socket option.
				/// </returns>
				static ISocketOption^	CreateOptionByName(SocketOptionName name);
			};
		}
	}
}
